home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global bckDrp, delayPassCount
- set delayPassCount to 0
- set the volume of sound 1 to 255
- set the volume of sound 2 to 180
- if (the stageTop = 0) and (the stageLeft = 0) then
- nothing()
- else
- if objectp(bckDrp) then
- bckDrp(mdispose)
- end if
- set bckDrp to Backdrop(mnew)
- bckDrp(mRegister, "20128802-373")
- bckDrp(mShow)
- end if
- end
-
- on stopMovie
- global bckDrp
- if objectp(bckDrp) then
- bckDrp(mdispose)
- end if
- end
-
- on LegalButtonHandler
- global quitHold
- set upB to the castNum of sprite the clickOn
- set fakeStillDown to 1
- repeat while fakeStillDown = 1
- set the castNum of sprite the clickOn to upB + rollOver(the clickOn)
- updateStage()
- wait(0.10000000000000001)
- set fakeStillDown to the stillDown
- end repeat
- set the castNum of sprite the clickOn to upB
- if rollOver(the clickOn) = 0 then
- set quitHold to 0
- abort()
- end if
- updateStage()
- puppetSound("buttonSound1")
- updateStage()
- repeat while soundBusy(1)
- nothing()
- end repeat
- puppetSound(0)
- end
-
- on myDelay t
- global delayPassCount
- if delayPassCount = 0 then
- startTimer()
- set delayPassCount to 1
- end if
- if the timer < (t * 60) then
- go(the frame)
- else
- set delayPassCount to 0
- end if
- end
-
- on wait t
- startTimer()
- repeat while the timer < (t * 60)
- nothing()
- end repeat
- end
-
- on noPuppets
- repeat with x = 1 to 35
- set the visible of sprite x to 1
- puppetSprite(x, 0)
- end repeat
- repeat with x = 40 to 48
- set the visible of sprite x to 1
- puppetSprite(x, 0)
- end repeat
- end
-
- on soundOff ch, t
- global delayFactor
- if soundBusy(ch) then
- set currentSound to the volume of sound ch
- repeat with i = currentSound down to 0
- set the volume of sound ch to i
- set delayFactor to 100
- repeat with x = 1 to t * delayFactor
- nothing()
- end repeat
- end repeat
- end if
- end
-
- on initQuestion
- global wrongRespCount, locationPrefix
- set wrongRespCount to 0
- if locationPrefix = "ma" then
- put "Match this animal ->" & RETURN & "with its picture." into field "maMsg"
- end if
- if locationPrefix = "QA" then
- put "Click on the correct answer to this question." into field "QAmsg"
- end if
- end
-
- on initFoodChain
- global rightRespCount, wrongRespCount, placedIconList
- put "Drag an icon to its correct position on the food chain." into field "FCmsg"
- set placedIconList to []
- set rightRespCount to 0
- set wrongRespCount to 0
- noPuppets()
- updateStage()
- end
-
- on iconFlash
- set upB to the castNum of sprite the clickOn
- set dwnB to upB + 1
- repeat with r = 1 to 3
- set the castNum of sprite the clickOn to dwnB
- updateStage()
- wait(0.20000000000000001)
- set the castNum of sprite the clickOn to upB
- updateStage()
- wait(0.20000000000000001)
- end repeat
- set the castNum of sprite the clickOn to dwnB
- updateStage()
- end
-
- on rightAnswer
- global rightCount
- set rightCount to rightCount + 1
- put "Good Work!" into field "qaMsg"
- iconFlash()
- wait(2)
- go(#next)
- end
-
- on rightAnswerAlt
- global rightCount
- put "That's correct!" into field "maMsg"
- updateStage()
- set rightCount to rightCount + 1
- go(the frame + 1)
- end
-
- on wrongAnswer1
- global wrongRespCount, wrongCount, locationPrefix
- set msgWin to locationPrefix & "msg"
- if wrongRespCount = 0 then
- put "Please try again." into field msgWin
- updateStage()
- set wrongRespCount to wrongRespCount + 1
- else
- put "Sorry." & RETURN & "The correct answer is:" into field msgWin
- updateStage()
- set wrongRespCount to 0
- set wrongCount to wrongCount + 1
- go(the frame + 1)
- end if
- end
-
- on snapIcon
- global origH, origV, rightSprite, rightAns, rightCount, wrongCount, rightRespCount, wrongRespCount, wrongRespLimit, placedIconList, delayFactor
- if rightSprite = 0 then
- repeat with ch = 11 to 10 + rightAns
- if sprite the clickOn intersects ch then
- if getOne(placedIconList, ch + 15) <> 0 then
- set the locH of sprite the clickOn to origH
- set the locV of sprite the clickOn to origV
- updateStage()
- exit
- end if
- end if
- end repeat
- repeat with ch = 11 to 10 + rightAns
- if sprite the clickOn intersects ch then
- if getOne(placedIconList, ch + 15) <> 0 then
- exit repeat
- end if
- set wrongRespCount to wrongRespCount + 1
- if wrongRespCount < wrongRespLimit then
- put "Please try again." into field "FCmsg"
- exit repeat
- next repeat
- end if
- put "Sorry." & RETURN & "The correct answer is:" into field "FCmsg"
- set wrongCount to wrongCount + 1
- set wrongRespCount to 0
- go(the frame + 1)
- exit
- end if
- end repeat
- set the locH of sprite the clickOn to origH
- set the locV of sprite the clickOn to origV
- updateStage()
- else
- if sprite the clickOn intersects rightSprite then
- set rightRespCount to rightRespCount + 1
- if rightRespCount = rightAns then
- set respName to "rightAns" & random(3)
- put "Good job!" into field "FCmsg"
- set rightCount to rightCount + 1
- set rightRespCount to 0
- noPuppets()
- go(#next)
- exit
- else
- put "That's right!" & RETURN & "Keep going!" into field "FCmsg"
- end if
- set the moveableSprite of sprite the clickOn to 0
- set the visible of sprite rightSprite to 0
- set the castNum of sprite the clickOn to the castNum of sprite the clickOn + 1
- puppetSprite(the clickOn, 1)
- set the locH of sprite the clickOn to the locH of sprite rightSprite
- set the locV of sprite the clickOn to the locV of sprite rightSprite
- updateStage()
- add(placedIconList, the clickOn)
- else
- repeat with ch = 11 to 10 + rightAns
- if sprite the clickOn intersects ch then
- if getOne(placedIconList, ch + 15) <> 0 then
- exit repeat
- end if
- set wrongRespCount to wrongRespCount + 1
- if wrongRespCount < wrongRespLimit then
- put "Try again, please." into field "FCmsg"
- exit repeat
- next repeat
- end if
- put "Sorry, the correct answer is:" into field "FCmsg"
- set wrongCount to wrongCount + 1
- set wrongRespCount to 0
- go(the frame + 1)
- exit
- end if
- end repeat
- set the locH of sprite the clickOn to origH
- set the locV of sprite the clickOn to origV
- updateStage()
- end if
- end if
- end
-